home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
util4
/
0utils.lha
/
0Utils
/
CAR.data
< prev
next >
Wrap
Text File
|
1995-09-05
|
2KB
|
85 lines
#ifdef TPLTER
CAR = {
NoParsing;
Version = "1.1";
Short = {{ Get the first in a list of Words }};
description = {{
Get the first word in a list of Words
CAR and CDR build a pair that is in most cases
used together.
}};
Notes = {{
We currently do ignore ReadArgs, so do not expext
"CAR ?" to work.
}};
Template = "/A/F";
Arguments = {{
STRPTR line;
# undef CDR
}};
History = {{
16-04-95 b_noll (1.0) created
19-08-95 b_noll created .data file
19-08-95 b_noll (1.1) added newline output to CAR branch
}};
Body = {{
STRPTR sline, rline, line;
line = GetArgStr();
if (line) {
sline = rline = line;
while (*line == ' ') line++;
if (*line && (*line != '\n')) {
UBYTE buffer[MAXLINELEN];
if (*line == '"') {
/* ---- closing quote */
++line;
while (*line && (*line != '"'))
if (*(line++) == '*')
if (*line)
line++;
} else {
/* ---- end of first word */
while (*line && (*line != ' '))
line++;
} /* if */
# if $(@isequal@CDR@$(CMD))
/* ---- Start of next word */
while (*line && (*line == ' '))
line++;
PutStr ((*line) ? line : "\n");
retval = *line ? RETURN_OK : RETURN_WARN;
# else
{
UBYTE ch;
ch = *line;
*line = 0;
PutStr (sline);
PutStr ("\n");
*line = ch;
retval = ch ? RETURN_OK : RETURN_WARN;
}
# endif
} else {
retval = RETURN_ERROR;
SetIoErr(ERROR_REQUIRED_ARG_MISSING);
} /* if */
} /* if */
}};
};
#endif